package top.lisicheng.common.listener.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.util.Map;

import static top.lisicheng.common.constant.RabbitMqConstant.WX_QUEUE;

/**
 * @author Lisicheng
 */
@Component
@RabbitListener(queues = WX_QUEUE)
@Slf4j
public class WxQueueListener {

    @RabbitHandler
    public void handle(@Payload String payload, @Headers Map<String,Object> headers) {
        log.info("pay:{}", payload);
        log.info("headers:{}", headers);
    }

}
